define(['app'],function(app){return {module: function($scope, $http, eventBusService, httpService, params) {
	//查询
	httpService.post(app.urls.unit_selectCompany,{"id":params.id},function(data){
		if("0000" === data.code){
			$scope.form = data.data[0];
		}else{
			alert(data.msg);
		}
	});
	
	$scope.saveForm = function(){
		if($scope.formCheck()) {
			httpService.post(app.urls.unit_updateCompany,$scope.form,function(data){
				if("0000" === data.code){
					$scope.goback();
				}else{
					alert(data.msg);
				}
			});
		}
	}
	//返回
	$scope.goback = function(){
		var menu = {};
		menu.url = "modules/content/unitmanagement/company/list?fk_menuid="+params.fk_menuid+"&father_id="+params.father_id;
		eventBusService.publish("modules.content.load",menu);
	}
}}});